Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[homekit] add configuration to disable listening to network interface changes #17979

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

yfre
Copy link
Contributor

@yfre yfre commented Dec 25, 2024

This PR makes HomeKit bridge restarts on network changes configurable.

Homekit addon listens to network interface changes, e.g.disconnect/reconnect/ip address changes, and stop & start homekit bridge for that interface. While this feature could be useful for dynamic ip address, it is suspected to create issues with static IP address and quick disconnects.
see https://community.openhab.org/t/homekit-stopps-working-after-a-certain-time-7-days/161003/2

This PR adds a switch for disable reaction on network changes. By default it is enabled, i.e. not changes to existing behaviour.

Signed-off-by: Eugen Freiter [email protected]

@yfre yfre added the bug An unexpected problem or unintended behavior of an add-on label Dec 25, 2024
@yfre yfre self-assigned this Dec 25, 2024
Signed-off-by: Eugen Freiter <[email protected]>
@openhab-bot
Copy link
Collaborator

This pull request has been mentioned on openHAB Community. There might be relevant details there:

https://community.openhab.org/t/homekit-stopps-working-after-a-certain-time-7-days/161003/11

@lsiepel
Copy link
Contributor

lsiepel commented Dec 25, 2024

Not sure if this is the right fix. While it would be an improvement for some specific cases. It actually hides the real problem.

  1. Wouldn’t it be better to solve the unstable connection itself?
  2. If the connection is broken due to whatever reason, the HomeKit binding should be able to handle it. Independent of being down 1 or 50 times a day. Obviously there is a limit to this, but I would assume that when HomeKit binding reaches this limit the whole host is unusable.

@yfre
Copy link
Contributor Author

yfre commented Dec 25, 2024

agree. it is not a proper solution, more a temporary workaround for a very strange issue.
it is still unclear to me what to fix.

my current theory is that VMs get very quick interface down & up, in few milliseconds. and either homekit addon (or OH) is messing up the sequence and first adding homekit to mDNS and then removing it, or mDNS is messing up the sequence.

it is difficult to troubleshoot as i cannot reproduce this issue on my side. i can interrupt network connection as often as i wish, homekit gets restarted correctly.
my hope, with this switch we could at least confirm that the issue is related to network interface changes.

@lsiepel
Copy link
Contributor

lsiepel commented Dec 29, 2024

Could it be that it is so short in time that the port is still occupied. Not sure if that makes sense, but the idea came to mind when reading this:
#17998 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug An unexpected problem or unintended behavior of an add-on
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants